<!DOCTYPE HTML>
<html>
	<head>

		<title>TradingView Charting Library demo</title>

		<!-- Fix for iOS Safari zooming bug -->
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">

		<script type="text/javascript" src="charting_library/charting_library.min.js"></script>
		<script type="text/javascript" src="datafeeds/udf/dist/polyfills.js"></script>
		<script type="text/javascript" src="datafeeds/udf/dist/bundle.js"></script>

		<script type="text/javascript">

			function getParameterByName(name) {
				name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
				var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
					results = regex.exec(location.search);
				return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
			}
			var stock = getParameterByName("stock");
        	var money = getParameterByName("money");
			TradingView.onready(function()
			{
				var widget = window.tvWidget = new TradingView.widget({
					// debug: true, // uncomment this line to see Library errors and warnings in the console
					fullscreen: true,
					symbol: stock+"/"+money,
					interval: '5',
					type:'bitcoin',
					timezone:getParameterByName("timezone")|| "Asia/Hong_Kong",
					container_id: "tv_chart_container",
					locale: getParameterByName('lang') || "en",	
					//	BEWARE: no trailing slash is expected in feed URL
					datafeed: new Datafeeds.UDFCompatibleDatafeed(document.location.protocol+"//"+document.location.host),
					library_path: "charting_library/",

					disabled_features: [
						"use_localstorage_for_settings",
						"volume_force_overlay",
						"legend_context_menu"
					],
					enabled_features: [
						//"study_templates"

					],
					overrides: {
	                    "mainSeriesProperties.style": 1,
	                    "volumePaneSize": "medium",
	                    "symbolWatermarkProperties.color": "rgba(0, 0, 0, 0)",
	                    "paneProperties.topMargin": 15,
	                    'paneProperties.legendProperties.showLegend': false,
					    'paneProperties.legendProperties.showStudyArguments': false,
						'paneProperties.legendProperties.showStudyTitles': false,
						'paneProperties.legendProperties.showStudyValues': false,
						'scalesProperties.showSeriesLastValue': true,
						'scalesProperties.showSeriesPrevCloseValue': false,
						'scalesProperties.showStudyLastValue': false,
						'scalesProperties.showStudyPlotLabels': false,
						'scalesProperties.showSymbolLabels': true,
	                    
	                },
	                studies_overrides: {
					    'ma cross.crosses:plot.plottype':"line",
					    'ma cross.crosses:plot.linewidth':"1",
					    
					},
					charts_storage_url: document.location.protocol+"//"+document.location.host,
					charts_storage_api_version: "1.1",
					client_id: 'tradingview.com',
					user_id: 'public_user_id',
					theme: getParameterByName('theme'),
				});
				widget.onChartReady(function() {
				    widget.chart().createStudy('MA Cross', false, false, [10], null, {'Crosses:Plot.plottype': 'line'});
				});
			});

		</script>

	</head>

	<body style="margin:0px;">
		<div id="tv_chart_container"></div>
	</body>

</html>
